<template>
    <div>
        <el-input type="textarea" v-model="con" show-word-limit :rows="15" maxlength="1000"/>
        <div style="margin: 20px 0 0 0;">
            <el-button size="small" type="primary" @click="confirm">确 定</el-button>
            <el-button size="small" @click="close">取 消</el-button>
        </div>
    </div>
</template>
<script setup>
import {ref,onMounted} from "vue"
const props = defineProps({
    options:{
        type:Object,
        default:{}
    }
})

const emit = defineEmits(['close'])

const con = ref('')
const defaultTxt = '准备：\n技术方法：\n执行要求：\n验收：'

onMounted(()=>{
    con.value = props.options.lineListItem.taskContent
    if(!con.value){
        con.value = defaultTxt
    }
    
})

const confirm = ()=>{
    if(con.value && con.value != defaultTxt){
        props.options.lineListItem.taskContent = con.value
    } 
    close()
}

const close=()=>{
    emit('close') 
}
</script>